<?php
/**
 * | @author 韩威兵^life <1877361302@qq.com>
 * +----------------------------------------------------------------------
 * | @copyright 2016 - 2019 HQ
 * +----------------------------------------------------------------------
 * | @version $Id: 2019/4/23 13:42 jiahe_new OldUser.php 韩威兵^life $
 * +----------------------------------------------------------------------
 */

namespace app\common\common\model\oldModel\admin;

//use app\common\common\model\base;
use app\common\common\model\oldModel\OldBase;
use think\Controller;
use think\Model;

class  oldUser extends OldBase {

    protected $table = 'user';

    //错误消息
    public $error = '';
    //状态值
    public $status = true;

    /**
     * 通过where条件查询数据
     * @param $where
     * @return false|\PDOStatement|string|\think\Collection
     */
    public function allByWhere($where)
    {
        return $this->where($where)->selectToArray();
    }

    /**
     * @param array $where
     */
    public function formatAllData($where=[]){
        $list = $this->allByWhere($where);
        foreach ($list as $k=>&$v){
            if(empty($v['name'])){
                $v['name'] = $v['user'];
            }
        }
        return $list;
    }


}  